import { useNavigate } from "react-router-dom";
import "./index.scss";

const Login = (): JSX.Element => {
  const navigate = useNavigate();
  const handleLogin = () => {
    navigate("/home");
    localStorage.setItem(
      "userInfo",
      JSON.stringify({
        userId: "1",
        avatar: "https://xsgames.co/randomusers/avatar.php?g=pixel&key=1",
        userName: "土豆哥",
        message: "你好",
        time: "12:40",
        status: "离线",
        type: "frend",
        count: 4,
        gender: "男",
        birday: "1990-01-01",
        phone: "18754215236",
        remark: "今天天气真好！"
      })
    );
  };
  return (
    <div className="login">
      <button onClick={() => handleLogin()}>登录</button>
    </div>
  );
};

export default Login;
